<template>
	<div>
		<NavigationBar title-text="医院详情" />
		<Message ref="message" />
		<Loading ref="loading" fullscreen />

		<div class="server-detail-container w-full pt-160rpx pb-0rpx px-0rpx bg-hex-a0cfff overflow-x-hidden">
			<div class="w-full min-h-90vh flex-column bg-white overflow-x-hidden">
				<div class="w-full h-400rpx">
					<image class="w-full h-full" :src="hospitalinfo.img" mode="aspectFill" />
				</div>
				<div class="w-full">
					<div class="bor w-full mt-20rpx pb-20rpx pl-30rpx text-38rpx font-bold">医院名称：{{ hospitalinfo.name }}</div>
					<div class="bor w-full mt-20rpx pb-20rpx pl-30rpx text-30rpx">规模：{{ hospitalinfo.scale===1?'小型':'大型' }}</div>
					<div class="bor w-full mt-20rpx pb-20rpx pl-30rpx text-30rpx">详细地址：{{ hospitalinfo.address }}</div>
					<div class="bor w-full mt-20rpx pb-20rpx pl-30rpx text-30rpx">所属机构：{{ hospitalinfo.institution }}</div>
					<div class="bor w-full mt-20rpx pb-20rpx pl-30rpx text-30rpx">咨讯电话：{{ hospitalinfo.phone }}</div>
					<div class="w-full mt-20rpx pb-20rpx pl-30rpx text-30rpx">医院简介</div>
					<div class="w-full pl-20rpx pr-20rpx">
						<div class="rad p-20rpx">
						{{ hospitalinfo.synopsis }}
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script setup lang="ts">
import Message from '@/components/message/src/message.vue';
import type { MessageMethod } from '@/components/message';
import Loading from '@/components/loading/src/loading.vue';
import type { LoadingMethod } from '@/components/loading';
import NavigationBar from '@/components/navigation-bar/src/navigation-bar.vue';
import { gotoPage } from '@/common/utils';
import { useUserStore } from '@/store';
import { systemApi } from '@/service/api';

const userStore = useUserStore();

const message = ref<InstanceType<typeof Message> & MessageMethod>(null);
const loading = ref<InstanceType<typeof Loading> & LoadingMethod>(null);

const hospitalinfo = ref({});
// 初始化
const init = async () => {
	const res = await systemApi.getHospitalinfo();
	console.log(res.data?.data.result[0]);
	hospitalinfo.value = res.data?.data.result[0];
};

// 返回上一页
const handleNavigateBack = (): void => {
	uni.navigateBack({
		delta: 2,
	});
};
onLoad((option) => {
	
    init();
});
onShow(() => {});
</script>

<style scoped lang="scss">
@import 'hospital';
</style>
